<%@ page language="java" contentType="text/html; charset=utf-8"
    pageEncoding="utf-8"%>
<%@include file="base.jsp" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<title>${attr.webTitle}</title>
<link href="${path}/admin123/css/main.css" rel="stylesheet" type="text/css" >
<link rel="stylesheet" type="text/css" href="${path}/js/jquery/easyui/themes/default/easyui.css">
<link rel="stylesheet" type="text/css" href="${path}/js/jquery/easyui/themes/icon.css">
<script src="${path}/js/jquery/easyui/jquery-1.8.0.min.js"></script>
<script src="${path}/js/jquery/easyui/jquery.easyui.min.js"></script>
<!-- rsa -->
<script type="text/javascript" src="${path}/js/rsa_js/RSA.js"></script>
<script type="text/javascript" src="${path}/js/rsa_js/BigInt.js"></script>
<script type="text/javascript" src="${path}/js/rsa_js/Barrett.js"></script>
<script type="text/javascript" src="${path}/js/rsa_js/myrsa.js?random=1"></script>
<script type="text/javascript" src="${path}/js/cookie/jquery.cookie.js"></script>
<script type="text/javascript">
$(function(){
	$('#win').window({
		closable:false,
		minimizable:false,
		collapsible:false,
		maximizable:false
	});

	//当前在iframe中
	if(location != top.location){
		window.parent.goOut();
	}

    var showMode = $.cookie('c_showMode_v');
	if(showMode != null)
    	$('input[name="showMode"][value="'+showMode+'"]').attr("checked",true);
});

function onEnterPressDown(){
	if(event.keyCode=='13'){
		submit1();
	}
}
function submit1(){

      if(!$('#form1').form('validate')){
		alert('数据填写不完整');
		return;
	  }

	  var st = $(this).attr('enable');
	  if(st=='0'){
		  return;
	  }
	  $(this).attr('enable','0');

	  rsaPwd('rsaPasswordId');

      $.cookie('c_showMode_v', $('input[name="showMode"]:checked').val(), {expires: 30});
	  $('#form1').submit();
      /*
	  //document.form1.submit();
	  setTimeout(function(){
	  	document.form1.submit();
	  },1000);
	  */
}


//全屏
function fullScreen(){
	fullScreenCore(document.documentElement);
}
function fullScreenCore(docElm){
	//W3C
	if (docElm.requestFullscreen) {
	    docElm.requestFullscreen();
	}
	//FireFox
	else if (docElm.mozRequestFullScreen) {
	    docElm.mozRequestFullScreen();
	}
	//Chrome等
	else if (docElm.webkitRequestFullScreen) {
	    docElm.webkitRequestFullScreen();
	}
	//IE11
	else if (elem.msRequestFullscreen) {
	  elem.msRequestFullscreen();
	}
}


</script>
<style type="text/css">
.app-wall {
	background: url('desktop/images/wall/3.png') fixed no-repeat center;
	position: relative;
	overflow: hidden;
	background-size:100%;
}
</style>
</head>
<body onkeydown="onEnterPressDown()" class="app-wall">
	<input type="hidden" value="please login first, it is a login page"/>
   <div style="color:red; text-align: center;">
  	${sessionScope['SPRING_SECURITY_LAST_EXCEPTION'].message}
  	<s:set var="SPRING_SECURITY_LAST_EXCEPTION" value="" scope="session"></s:set>
  	<s:property value="#attr.result"/>
   </div>
   <div id="win" class="easyui-window" title="${attr.webTitle}-登录" style="width:520px; height: 310px;">
	   <s:form name="form1" id="form1" action="emp_login.action" namespace="/admin123" theme="simple" cssStyle="padding:10px 20px 10px 40px;">
	      <table style="line-height: 35px; " align="center">
	      	<tr>
	      		<td>用户名： </td>
	      		<td><input type="text" name="username" value="" class="easyui-validatebox" data-options="required:true"  maxlength="20" size="36"></td>
	      	</tr>
	      	<tr>
	      		<td>密码：</td>
	      		<td>
	      			<input type="password" name="password" value="" id="rsaPasswordId" class="easyui-validatebox" data-options="required:true" maxlength="40" size="20">
	      			<input type="hidden" value="密码安全控件" onclick="showkeyboard('form1.password')">
	      		</td>
	      	</tr>
	      	<tr>
	      		<td colspan="2">
	      			<div id="keyboardContainer" style="position: absolute;left: 2px;z-index:18000;"/>
	      		</td>
	      	</tr>
			<s:if test="#attr.isLoginSuccessBack==-1">
	      	<tr>
	      		<td>校验码：</td>
	      		<td>
	      			<input type="text" name="validateCode" size="6">
	      			<img alt="" src="_validate.jsp" id="validateObj">
	      			<a style="cursor: pointer;"  onclick="javascript:document.getElementById('validateObj').src='_validate.jsp?time='+new Date();">
						换一张
					</a>
	      		</td>
	      	</tr>
	      	</s:if>
	      	<tr>
	      		<td colspan="2">
	      			<input type="hidden" name="showMode"  value="desktop"><%--桌面模式--%>
	      			<input type="radio" name="showMode"  value="menu" checked="checked">菜单模式
	      		</td>
	      	</tr>
	      	<tr>
	      		<td colspan="2">
			      <a href="javascript:void(0);" class="easyui-linkbutton"
					 style="margin-left: 120px;"
					 data-options="iconCls:'icon-ok'"
					 onclick="javascript:submit1();">登录</a>
	      		</td>
	      	</tr>
	      	<tr>
	      		<td style="color: red;" colspan="2">注：使用360极速浏览器、火狐浏览器、google浏览器运行效果更好。</td>
	      	</tr>
	      </table>
	   </s:form>
   </div>
</body>
<script type="text/javascript" src="${path}/js/keyboard.js"></script>
</html>
<%
	session.invalidate();
%>
